#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1e6 + 10;
int ret[N];
int maxs_to_i[N];
int mins_to_i[N];
bool cmp(const string& s1,const string& s2)
{
	if (s1.size() != s2.size())
		return s1.size() < s2.size();
	else//s1.size()==s2.size()
		return s1 < s2;//字典序比较
}
int main()
{
	string max_s, min_s;
	cin >> max_s >> min_s;
	//假设max_s字符串对应的值大于等于min_s字符串对应的值,如果不符合再交换
	if (cmp(max_s, min_s))//为真(max_s对应的数字小于min_s)则交换
	{
		swap(max_s, min_s);
		cout << "-";//小数减大数,先输出负号
	}
	int len1 = max_s.size();
	int len2 = min_s.size();
	for (int i = 0; i < max_s.size(); i++)
		maxs_to_i[len1 - i - 1] = max_s[i] - '0';
	for (int j = 0; j < min_s.size(); j++)
		mins_to_i[len2 - j - 1] = min_s[j] - '0';
	
	int k = 0;
	for (; k < max(len1, len2); k++)
	{
		ret[k] += maxs_to_i[k] - mins_to_i[k];//在相减的同时需要处理借位
		if (ret[k] < 0)//结果小于0,则借位
		{
			ret[k + 1] -= 1;
			ret[k] += 10;
		}
	}

	while (ret[k] == 0&&k!=0)
	{
		k--;
	}

	for (; k >= 0; k--)
		cout << ret[k];
	return 0;
}